package com.bdqn.sz.aopjdk;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
import org.apache.log4j.Logger;
import java.lang.reflect.Method;
public class CGLIBLogg implements MethodInterceptor {
    private Logger logger= Logger.getLogger(CGLIBServiceImpl.class);
    @Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        logger.debug("开始 ");
        // 调用目标对象上的方法
        Object result = proxy.invokeSuper(obj, args);
       logger.debug("结束");
        return result;
    }
}
